module.exports = function($scope, $state, $stateParams, $resource, toaster){

	$scope.notice = {
        sort: 1,
        type: $stateParams.type
    };

	$scope.gogo = function(){
		$resource('/api/as/ggc/notice/save', {}, {}).save($scope.notice, function (res) {
            if (res.errcode === 0){
                toaster.success({title: '', body: '发布成功'});
                $state.go('app.noticeList')
            } else {
                toaster.error({title: '', body: res.errmsg});
            }
        });
	};
	
};